<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<title>std::atomic - cppreference.com</title>
<meta charset="UTF-8">
<meta name="generator" content="MediaWiki 1.21.2">
<link rel="shortcut icon" href="../../../common/favicon.ico">
<link rel="stylesheet" href="../../../common/ext.css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" href="../../../common/site_modules.css">
<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}#toc{display:none}.editsection{display:none}
/* cache key: mwiki1-mwiki_en_:resourceloader:filter:minify-css:7:472787eddcf4605d11de8c7ef047234f */</style>

<script src="../../../common/startup_scripts.js"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"cpp/atomic/atomic","wgTitle":"cpp/atomic/atomic","wgCurRevisionId":141391,"wgArticleId":4734,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"cpp/atomic/atomic","wgRestrictionEdit":[],"wgRestrictionMove":[]});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function(){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"justify":0,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":0,"showjumplinks":1,"shownumberswatching":1,"showtoc":0,"showtoolbar":1,"skin":"cppreference2","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":0,"watchdefault":0,"watchdeletion":0,
"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"variant":"en","language":"en","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"gadget-ColiruCompiler":1,"gadget-MathJax":1});;},{},{});mw.loader.implement("user.tokens",function(){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});;},{},{});
/* cache key: mwiki1-mwiki_en_:resourceloader:filter:minify-js:7:9f05c6caceb9bb1a482b6cebd4c5a330 */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
<style type="text/css">/*<![CDATA[*/
.source-cpp {line-height: normal;}
.source-cpp li, .source-cpp pre {
	line-height: normal; border: 0px none white;
}
/**
 * GeSHi Dynamically Generated Stylesheet
 * --------------------------------------
 * Dynamically generated stylesheet for cpp
 * CSS class: source-cpp, CSS id: 
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 * --------------------------------------
 */
.cpp.source-cpp .de1, .cpp.source-cpp .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.cpp.source-cpp  {font-family:monospace;}
.cpp.source-cpp .imp {font-weight: bold; color: red;}
.cpp.source-cpp li, .cpp.source-cpp .li1 {font-weight: normal; vertical-align:top;}
.cpp.source-cpp .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.cpp.source-cpp .li2 {font-weight: bold; vertical-align:top;}
.cpp.source-cpp .kw1 {color: #0000dd;}
.cpp.source-cpp .kw2 {color: #0000ff;}
.cpp.source-cpp .kw3 {color: #0000dd;}
.cpp.source-cpp .kw4 {color: #0000ff;}
.cpp.source-cpp .co1 {color: #909090;}
.cpp.source-cpp .co2 {color: #339900;}
.cpp.source-cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp.source-cpp .es0 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es1 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es2 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es3 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es4 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es5 {color: #008000; font-weight: bold;}
.cpp.source-cpp .br0 {color: #008000;}
.cpp.source-cpp .sy0 {color: #008000;}
.cpp.source-cpp .sy1 {color: #000080;}
.cpp.source-cpp .sy2 {color: #000040;}
.cpp.source-cpp .sy3 {color: #000040;}
.cpp.source-cpp .sy4 {color: #008080;}
.cpp.source-cpp .st0 {color: #008000;}
.cpp.source-cpp .nu0 {color: #000080;}
.cpp.source-cpp .nu6 {color: #000080;}
.cpp.source-cpp .nu8 {color: #000080;}
.cpp.source-cpp .nu12 {color: #000080;}
.cpp.source-cpp .nu16 {color:#000080;}
.cpp.source-cpp .nu17 {color:#000080;}
.cpp.source-cpp .nu18 {color:#000080;}
.cpp.source-cpp .nu19 {color:#000080;}
.cpp.source-cpp .ln-xtra, .cpp.source-cpp li.ln-xtra, .cpp.source-cpp div.ln-xtra {background-color: #ffc;}
.cpp.source-cpp span.xtra { display:block; }

/*]]>*/
</style><!--[if lt IE 7]><style type="text/css">body{behavior:url("/mwiki/skins/cppreference2/csshover.min.htc")}</style><![endif]--></head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_atomic_atomic skin-cppreference2 action-view cpp-navbar">
        <!-- header -->
        <!-- /header -->
        <!-- content -->
<div id="cpp-content-base">
            <div id="content">
                <a id="top"></a>
                <div id="mw-js-message" style="display:none;"></div>
                                <!-- firstHeading -->
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">std::</span>atomic</h1>
                <!-- /firstHeading -->
                <!-- bodyContent -->
                <div id="bodyContent">
                                        <!-- tagline -->
                    <div id="siteSub">From cppreference.com</div>
                    <!-- /tagline -->
                                        <!-- subtitle -->
                    <div id="contentSub"><span class="subpages">&lt; <a href="../../cpp.html" title="cpp">cpp</a>‎ | <a href="../atomic.html" title="cpp/atomic">atomic</a></span></div>
                    <!-- /subtitle -->
                                                            <!-- bodycontent -->
                    <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="t-navbar" style=""><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../../cpp.html" title="cpp"> C++</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em;">
<tr class="t-nv"><td colspan="5"> <a href="../compiler_support.html" title="cpp/compiler support"> Compiler support</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../freestanding.html" title="cpp/freestanding"> Freestanding and hosted</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../language.html" title="cpp/language"> Language</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../header.html" title="cpp/header"> Standard library headers</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../named_req.html" title="cpp/named req"> Named requirements </a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../feature_test.html" title="cpp/feature test"> Feature test macros </a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../utility.html#Language_support" title="cpp/utility"> Language support library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../concepts.html" title="cpp/concepts"> Concepts library</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../meta.html" title="cpp/meta"> Metaprogramming library</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../error.html" title="cpp/error"> Diagnostics library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../utility.html" title="cpp/utility"> General utilities library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../string.html" title="cpp/string"> Strings library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../container.html" title="cpp/container"> Containers library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../iterator.html" title="cpp/iterator"> Iterators library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../ranges.html" title="cpp/ranges"> Ranges library</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../algorithm.html" title="cpp/algorithm"> Algorithms library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../numeric.html" title="cpp/numeric"> Numerics library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../locale.html" title="cpp/locale"> Localizations library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../io.html" title="cpp/io"> Input/output library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../filesystem.html" title="cpp/filesystem"> Filesystem library</a> <span class="t-mark-rev t-since-cxx17">(C++17)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../regex.html" title="cpp/regex"> Regular expressions library</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../thread.html" title="cpp/thread"> Concurrency support library</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../experimental.html" title="cpp/experimental"> Technical specifications</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../symbol_index.html" title="cpp/symbol index"> Symbols index</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../links/libs.html" title="cpp/links/libs"> External libraries</a> </td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../thread.html" title="cpp/thread"> Concurrency support library</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv-h1"><td colspan="5"> Threads</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/thread.html" title="cpp/thread/thread"><span class="t-lines"><span>thread</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/jthread.html" title="cpp/thread/jthread"><span class="t-lines"><span>jthread</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/stop_token.html" title="cpp/thread/stop token"><span class="t-lines"><span>stop_token</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/stop_source.html" title="cpp/thread/stop source"><span class="t-lines"><span>stop_source</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/stop_callback.html" title="cpp/thread/stop callback"><span class="t-lines"><span>stop_callback</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/hardware_destructive_interference_size.html" title="cpp/thread/hardware destructive interference size"><span class="t-lines"><span>hardware_destructive_interference_size</span><span>hardware_constructive_interference_size</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span><span><span class="t-mark-rev t-since-cxx17">(C++17)</span>    </span></span></div></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> <code>this_thread</code> namespace</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/get_id.html" title="cpp/thread/get id"><span class="t-lines"><span>get_id</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/yield.html" title="cpp/thread/yield"><span class="t-lines"><span>yield</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/sleep_for.html" title="cpp/thread/sleep for"><span class="t-lines"><span>sleep_for</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/sleep_until.html" title="cpp/thread/sleep until"><span class="t-lines"><span>sleep_until</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Atomic types</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><strong class="selflink"><span class="t-lines"><span>atomic</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_ref.html" title="cpp/atomic/atomic ref"><span class="t-lines"><span>atomic_ref</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_flag.html" title="cpp/atomic/atomic flag"><span class="t-lines"><span>atomic_flag</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> Initialization of atomic types</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_init.html" title="cpp/atomic/atomic init"><span class="t-lines"><span>atomic_init</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark-rev t-deprecated-cxx20">(deprecated in C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="ATOMIC_VAR_INIT.html" title="cpp/atomic/ATOMIC VAR INIT"><span class="t-lines"><span>ATOMIC_VAR_INIT</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark-rev t-deprecated-cxx20">(deprecated in C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="ATOMIC_FLAG_INIT.html" title="cpp/atomic/ATOMIC FLAG INIT"><span class="t-lines"><span>ATOMIC_FLAG_INIT</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Free functions for atomic operations</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_store.html" title="cpp/atomic/atomic store"><span class="t-lines"><span>atomic_store</span><span>atomic_store_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_load.html" title="cpp/atomic/atomic load"><span class="t-lines"><span>atomic_load</span><span>atomic_load_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_exchange.html" title="cpp/atomic/atomic exchange"><span class="t-lines"><span>atomic_exchange</span><span>atomic_exchange_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_compare_exchange.html" title="cpp/atomic/atomic compare exchange"><span class="t-lines"><span>atomic_compare_exchange_weak</span><span>atomic_compare_exchange_weak_explicit</span><span>atomic_compare_exchange_strong</span><span>atomic_compare_exchange_strong_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_fetch_add.html" title="cpp/atomic/atomic fetch add"><span class="t-lines"><span>atomic_fetch_add</span><span>atomic_fetch_add_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_fetch_sub.html" title="cpp/atomic/atomic fetch sub"><span class="t-lines"><span>atomic_fetch_sub</span><span>atomic_fetch_sub_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_fetch_and.html" title="cpp/atomic/atomic fetch and"><span class="t-lines"><span>atomic_fetch_and</span><span>atomic_fetch_and_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_fetch_or.html" title="cpp/atomic/atomic fetch or"><span class="t-lines"><span>atomic_fetch_or</span><span>atomic_fetch_or_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_fetch_xor.html" title="cpp/atomic/atomic fetch xor"><span class="t-lines"><span>atomic_fetch_xor</span><span>atomic_fetch_xor_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_is_lock_free.html" title="cpp/atomic/atomic is lock free"><span class="t-lines"><span>atomic_is_lock_free</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_wait.html" title="cpp/atomic/atomic wait"><span class="t-lines"><span>atomic_wait</span><span>atomic_wait_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_notify_one.html" title="cpp/atomic/atomic notify one"><span class="t-lines"><span>atomic_notify_one</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_notify_all.html" title="cpp/atomic/atomic notify all"><span class="t-lines"><span>atomic_notify_all</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv-h1"><td colspan="5"> Free functions for atomic flags</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_flag_test_and_set.html" title="cpp/atomic/atomic flag test and set"><span class="t-lines"><span>atomic_flag_test_and_set</span><span>atomic_flag_test_and_set_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_flag_clear.html" title="cpp/atomic/atomic flag clear"><span class="t-lines"><span>atomic_flag_clear</span><span>atomic_flag_clear_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_flag_test.html" title="cpp/atomic/atomic flag test"><span class="t-lines"><span>atomic_flag_test</span><span>atomic_flag_test_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_flag_wait.html" title="cpp/atomic/atomic flag wait"><span class="t-lines"><span>atomic_flag_wait</span><span>atomic_flag_wait_explicit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_flag_notify_one.html" title="cpp/atomic/atomic flag notify one"><span class="t-lines"><span>atomic_flag_notify_one</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_flag_notify_all.html" title="cpp/atomic/atomic flag notify all"><span class="t-lines"><span>atomic_flag_notify_all</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Memory ordering</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="memory_order.html" title="cpp/atomic/memory order"><span class="t-lines"><span>memory_order</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="kill_dependency.html" title="cpp/atomic/kill dependency"><span class="t-lines"><span>kill_dependency</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_thread_fence.html" title="cpp/atomic/atomic thread fence"><span class="t-lines"><span>atomic_thread_fence</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic_signal_fence.html" title="cpp/atomic/atomic signal fence"><span class="t-lines"><span>atomic_signal_fence</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Mutual exclusion</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/mutex.html" title="cpp/thread/mutex"><span class="t-lines"><span>mutex</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/recursive_mutex.html" title="cpp/thread/recursive mutex"><span class="t-lines"><span>recursive_mutex</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/shared_mutex.html" title="cpp/thread/shared mutex"><span class="t-lines"><span>shared_mutex</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/timed_mutex.html" title="cpp/thread/timed mutex"><span class="t-lines"><span>timed_mutex</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/recursive_timed_mutex.html" title="cpp/thread/recursive timed mutex"><span class="t-lines"><span>recursive_timed_mutex</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/shared_timed_mutex.html" title="cpp/thread/shared timed mutex"><span class="t-lines"><span>shared_timed_mutex</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx14">(C++14)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> Generic lock management</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/lock_guard.html" title="cpp/thread/lock guard"><span class="t-lines"><span>lock_guard</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/scoped_lock.html" title="cpp/thread/scoped lock"><span class="t-lines"><span>scoped_lock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/unique_lock.html" title="cpp/thread/unique lock"><span class="t-lines"><span>unique_lock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/shared_lock.html" title="cpp/thread/shared lock"><span class="t-lines"><span>shared_lock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx14">(C++14)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/lock_tag_t.html" title="cpp/thread/lock tag t"><span class="t-lines"><span>defer_lock_t</span><span>try_to_lock_t</span><span>adopt_lock_t</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/lock.html" title="cpp/thread/lock"><span class="t-lines"><span>lock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/try_lock.html" title="cpp/thread/try lock"><span class="t-lines"><span>try_lock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/lock_tag.html" title="cpp/thread/lock tag"><span class="t-lines"><span>defer_lock</span><span>try_to_lock</span><span>adopt_lock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/once_flag.html" title="cpp/thread/once flag"><span class="t-lines"><span>once_flag</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/call_once.html" title="cpp/thread/call once"><span class="t-lines"><span>call_once</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Condition variables</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/condition_variable.html" title="cpp/thread/condition variable"><span class="t-lines"><span>condition_variable</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/condition_variable_any.html" title="cpp/thread/condition variable any"><span class="t-lines"><span>condition_variable_any</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/notify_all_at_thread_exit.html" title="cpp/thread/notify all at thread exit"><span class="t-lines"><span>notify_all_at_thread_exit</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/cv_status.html" title="cpp/thread/cv status"><span class="t-lines"><span>cv_status</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Semaphores</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/counting_semaphore.html" title="cpp/thread/counting semaphore"><span class="t-lines"><span>counting_semaphore</span><span>binary_semaphore</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Latches and barriers</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/latch.html" title="cpp/thread/latch"><span class="t-lines"><span>latch</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/barrier.html" title="cpp/thread/barrier"><span class="t-lines"><span>barrier</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Futures</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/promise.html" title="cpp/thread/promise"><span class="t-lines"><span>promise</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/future.html" title="cpp/thread/future"><span class="t-lines"><span>future</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/shared_future.html" title="cpp/thread/shared future"><span class="t-lines"><span>shared_future</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/packaged_task.html" title="cpp/thread/packaged task"><span class="t-lines"><span>packaged_task</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/async.html" title="cpp/thread/async"><span class="t-lines"><span>async</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/launch.html" title="cpp/thread/launch"><span class="t-lines"><span>launch</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/future_status.html" title="cpp/thread/future status"><span class="t-lines"><span>future_status</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/future_error.html" title="cpp/thread/future error"><span class="t-lines"><span>future_error</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/future/future_category.html" title="cpp/thread/future category"><span class="t-lines"><span>future_category</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../thread/future_errc.html" title="cpp/thread/future errc"><span class="t-lines"><span>future_errc</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
</table></div></td></tr>
</table></div></td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><strong class="selflink"><tt>std::atomic</tt></strong><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv-h1"><td colspan="5"> Member functions</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/atomic.html" title="cpp/atomic/atomic/atomic"><span class="t-lines"><span>atomic::atomic</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/operator%3D.html" title="cpp/atomic/atomic/operator="><span class="t-lines"><span>atomic::operator=</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/is_lock_free.html" title="cpp/atomic/atomic/is lock free"><span class="t-lines"><span>atomic::is_lock_free</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/store.html" title="cpp/atomic/atomic/store"><span class="t-lines"><span>atomic::store</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/load.html" title="cpp/atomic/atomic/load"><span class="t-lines"><span>atomic::load</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/operator_T.html" title="cpp/atomic/atomic/operator T"><span class="t-lines"><span>atomic::operator T</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/exchange.html" title="cpp/atomic/atomic/exchange"><span class="t-lines"><span>atomic::exchange</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/compare_exchange.html" title="cpp/atomic/atomic/compare exchange"><span class="t-lines"><span>atomic::compare_exchange_strong</span><span>atomic::compare_exchange_weak</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/wait.html" title="cpp/atomic/atomic/wait"><span class="t-lines"><span>atomic::wait</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/notify_one.html" title="cpp/atomic/atomic/notify one"><span class="t-lines"><span>atomic::notify_one</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/notify_all.html" title="cpp/atomic/atomic/notify all"><span class="t-lines"><span>atomic::notify_all</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Constants </td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/is_always_lock_free.html" title="cpp/atomic/atomic/is always lock free"><span class="t-lines"><span>atomic::is_always_lock_free</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Specialized member functions</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/fetch_add.html" title="cpp/atomic/atomic/fetch add"><span class="t-lines"><span>atomic::fetch_add</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/fetch_sub.html" title="cpp/atomic/atomic/fetch sub"><span class="t-lines"><span>atomic::fetch_sub</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/fetch_and.html" title="cpp/atomic/atomic/fetch and"><span class="t-lines"><span>atomic::fetch_and</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/fetch_or.html" title="cpp/atomic/atomic/fetch or"><span class="t-lines"><span>atomic::fetch_or</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/fetch_xor.html" title="cpp/atomic/atomic/fetch xor"><span class="t-lines"><span>atomic::fetch_xor</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/operator_arith.html" title="cpp/atomic/atomic/operator arith"><span class="t-lines"><span>atomic::operator++</span><span>atomic::operator++(int)</span><span>atomic::operator--</span><span>atomic::operator--(int)</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="atomic/operator_arith2.html" title="cpp/atomic/atomic/operator arith2"><span class="t-lines"><span>atomic::operator+=</span><span>atomic::operator-=</span><span>atomic::operator&amp;=</span><span>atomic::operator|=</span><span>atomic::operator^=</span></span></a></div></div></td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div></div>
<table class="t-dcl-begin"><tbody>
<tr class="t-dsc-header">
<td> <div>Defined in header <code><a href="../header/atomic.html" title="cpp/header/atomic">&lt;atomic&gt;</a></code>
 </div></td>
<td></td>
<td></td>
</tr>
<tr class="t-dcl t-since-cxx11">
<td> <div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> T <span class="sy1">&gt;</span><br>
<span class="kw1">struct</span> atomic<span class="sy4">;</span></span></div></td>
<td> (1) </td>
<td> <span class="t-mark-rev t-since-cxx11">(since C++11)</span> </td>
</tr>
<tr class="t-dcl t-since-cxx11">
<td> <div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> U <span class="sy1">&gt;</span><br>
<span class="kw1">struct</span> atomic<span class="sy1">&lt;</span>U<span class="sy2">*</span><span class="sy1">&gt;</span><span class="sy4">;</span></span></div></td>
<td> (2) </td>
<td> <span class="t-mark-rev t-since-cxx11">(since C++11)</span> </td>
</tr>
<tr class="t-dsc-header">
<td> <div>Defined in header <code><a href="../header/memory.html" title="cpp/header/memory">&lt;memory&gt;</a></code>
 </div></td>
<td></td>
<td></td>
</tr>
<tr class="t-dcl t-since-cxx20">
<td> <div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> U <span class="sy1">&gt;</span><br>
<span class="kw1">struct</span> atomic<span class="sy1">&lt;</span><a href="../memory/shared_ptr.html"><span class="kw735">std::<span class="me2">shared_ptr</span></span></a><span class="sy1">&lt;</span>U<span class="sy1">&gt;&gt;</span><span class="sy4">;</span></span></div></td>
<td> (3) </td>
<td> <span class="t-mark-rev t-since-cxx20">(since C++20)</span> </td>
</tr>
<tr class="t-dcl t-since-cxx20">
<td> <div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> U <span class="sy1">&gt;</span><br>
<span class="kw1">struct</span> atomic<span class="sy1">&lt;</span><a href="../memory/weak_ptr.html"><span class="kw742">std::<span class="me2">weak_ptr</span></span></a><span class="sy1">&lt;</span>U<span class="sy1">&gt;&gt;</span><span class="sy4">;</span></span></div></td>
<td> (4) </td>
<td> <span class="t-mark-rev t-since-cxx20">(since C++20)</span> </td>
</tr>
<tr class="t-dsc-header">
<td> <div>Defined in header <code><a href="../header/stdatomic.h.html" title="cpp/header/stdatomic.h">&lt;stdatomic.h&gt;</a></code>
 </div></td>
<td></td>
<td></td>
</tr>
<tr class="t-dcl t-since-cxx23">
<td> <div><span class="mw-geshi cpp source-cpp"><span class="co2">#define _Atomic(T) /* see below */</span></span></div></td>
<td> (5) </td>
<td> <span class="t-mark-rev t-since-cxx23">(since C++23)</span> </td>
</tr>
<tr class="t-dcl-sep"><td></td><td></td><td></td></tr>
</tbody></table>
<p>Each instantiation and full specialization of the <code>std::atomic</code> template defines an atomic type. If one thread writes to an atomic object while another thread reads from it, the behavior is well-defined (see <a href="../language/memory_model.html" title="cpp/language/memory model">memory model</a> for details on data races).
</p><p>In addition, accesses to atomic objects may establish inter-thread synchronization and order non-atomic memory accesses as specified by <span class="t-lc"><a href="memory_order.html" title="cpp/atomic/memory order">std::memory_order</a></span>.
</p><p><code>std::atomic</code> is neither copyable nor movable.
</p>
 <table class="t-rev-begin">
<tr class="t-rev t-since-cxx23"><td>
<p>The compatibility macro <code>_Atomic</code> is provided in <a href="../header/stdatomic.h.html" title="cpp/header/stdatomic.h"><tt>&lt;stdatomic.h&gt;</tt></a> such that <span class="t-c"><span class="mw-geshi cpp source-cpp">_Atomic<span class="br0">(</span>T<span class="br0">)</span></span></span> is identical to <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span>T<span class="sy1">&gt;</span></span></span> while both are well-formed.
</p><p>It is unspecified whether any declaration in namespace <code>std</code> is available when <code>&lt;stdatomic.h&gt;</code> is included.
</p>
</td>
<td><span class="t-mark-rev t-since-cxx23">(since C++23)</span></td></tr>
</table>
<h3><span class="mw-headline" id="Specializations"> Specializations </span></h3>
<h4><span class="mw-headline" id="Primary_template">Primary template</span></h4>
<p>The primary <code>std::atomic</code> template may be instantiated with any <a href="../named_req/TriviallyCopyable.html" title="cpp/named req/TriviallyCopyable"><span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">TriviallyCopyable</span></a> type <code>T</code> satisfying both <a href="../named_req/CopyConstructible.html" title="cpp/named req/CopyConstructible"><span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">CopyConstructible</span></a> and <a href="../named_req/CopyAssignable.html" title="cpp/named req/CopyAssignable"><span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">CopyAssignable</span></a>. The program is ill-formed if any of following values is <code>false</code>:
</p>
<ul><li> <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../types/is_trivially_copyable.html"><span class="kw506">std::<span class="me2">is_trivially_copyable</span></span></a><span class="sy1">&lt;</span>T<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">value</span></span></span>
</li><li> <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../types/is_copy_constructible.html"><span class="kw538">std::<span class="me2">is_copy_constructible</span></span></a><span class="sy1">&lt;</span>T<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">value</span></span></span>
</li><li> <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../types/is_move_constructible.html"><span class="kw544">std::<span class="me2">is_move_constructible</span></span></a><span class="sy1">&lt;</span>T<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">value</span></span></span>
</li><li> <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../types/is_copy_assignable.html"><span class="kw556">std::<span class="me2">is_copy_assignable</span></span></a><span class="sy1">&lt;</span>T<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">value</span></span></span>
</li><li> <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../types/is_move_assignable.html"><span class="kw562">std::<span class="me2">is_move_assignable</span></span></a><span class="sy1">&lt;</span>T<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">value</span></span></span>
</li></ul>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">struct</span> Counters <span class="br0">{</span> <span class="kw4">int</span> a<span class="sy4">;</span> <span class="kw4">int</span> b<span class="sy4">;</span> <span class="br0">}</span><span class="sy4">;</span> <span class="co1">// user-defined trivially-copyable type</span>
std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span>Counters<span class="sy1">&gt;</span> cnt<span class="sy4">;</span>         <span class="co1">// specialization for the user-defined type</span></pre></div></div>
<p><span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">bool</span><span class="sy1">&gt;</span></span></span> uses the primary template. It is guaranteed to be a standard layout struct.
</p>
<h4><span class="mw-headline" id="Partial_specializations">Partial specializations</span></h4>
<p>The standard library provides partial specializations of the <code>std::atomic</code> template for the following types with additional properties that the primary template does not have: 
</p><p>2) Partial specializations <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span>U<span class="sy2">*</span><span class="sy1">&gt;</span></span></span> for all pointer types. These specializations have standard layout<span class="t-rev-inl t-until-cxx20"><span>, trivial default constructors,</span> <span><span class="t-mark-rev t-until-cxx20">(until C++20)</span></span></span> and trivial destructors. Besides the operations provided for all atomic types, these specializations additionally support atomic arithmetic operations appropriate to pointer types, such as <a href="atomic/fetch_add.html" title="cpp/atomic/atomic/fetch add"><code>fetch_add</code></a>, <a href="atomic/fetch_sub.html" title="cpp/atomic/atomic/fetch sub"><code>fetch_sub</code></a>.
</p>
 <table class="t-rev-begin">
<tr class="t-rev t-since-cxx20"><td>
<p>3-4) Partial specializations <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../memory/shared_ptr.html"><span class="kw735">std::<span class="me2">shared_ptr</span></span></a><span class="sy1">&lt;</span>U<span class="sy1">&gt;&gt;</span></span></span> and <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../memory/weak_ptr.html"><span class="kw742">std::<span class="me2">weak_ptr</span></span></a><span class="sy1">&lt;</span>U<span class="sy1">&gt;&gt;</span></span></span> are provided for <span class="t-lc"><a href="../memory/shared_ptr.html" title="cpp/memory/shared ptr">std::shared_ptr</a></span> and <span class="t-lc"><a href="../memory/weak_ptr.html" title="cpp/memory/weak ptr">std::weak_ptr</a></span>.
</p><p>See <a href="../memory/shared_ptr/atomic2.html" title="cpp/memory/shared ptr/atomic2">std::atomic<span class="t-dsc-small">&lt;std::shared_ptr&gt;</span></a> and <a href="../memory/weak_ptr/atomic2.html" title="cpp/memory/weak ptr/atomic2">std::atomic<span class="t-dsc-small">&lt;std::weak_ptr&gt;</span></a> for details.
</p>
</td>
<td><span class="t-mark-rev t-since-cxx20">(since C++20)</span></td></tr>
</table>
<h4><span class="mw-headline" id="Specializations_for_integral_types"> Specializations for integral types </span></h4>
<p>When instantiated with one of the following integral types, <code>std::atomic</code> provides additional atomic operations appropriate to integral types such as <a href="atomic/fetch_add.html" title="cpp/atomic/atomic/fetch add"><code>fetch_add</code></a>, <a href="atomic/fetch_sub.html" title="cpp/atomic/atomic/fetch sub"><code>fetch_sub</code></a>, <a href="atomic/fetch_and.html" title="cpp/atomic/atomic/fetch and"><code>fetch_and</code></a>, <a href="atomic/fetch_or.html" title="cpp/atomic/atomic/fetch or"><code>fetch_or</code></a>, <a href="atomic/fetch_xor.html" title="cpp/atomic/atomic/fetch xor"><code>fetch_xor</code></a>:
</p>
<dl><dd><ul><li> The character types <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">char</span></span></span><span class="t-rev-inl t-since-cxx20"><span>, <span class="t-c"><span class="mw-geshi cpp source-cpp">char8_t</span></span></span> <span><span class="t-mark-rev t-since-cxx20">(since C++20)</span></span></span>, <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">char16_t</span></span></span>, <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">char32_t</span></span></span>, and <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">wchar_t</span></span></span>;
</li><li> The standard signed integer types: <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">signed</span> <span class="kw4">char</span></span></span>, <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">short</span></span></span>, <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">int</span></span></span>, <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">long</span></span></span>, and <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">long</span> <span class="kw4">long</span></span></span>;
</li><li> The standard unsigned integer types: <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">unsigned</span> <span class="kw4">char</span></span></span>, <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">unsigned</span> <span class="kw4">short</span></span></span>, <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">unsigned</span> <span class="kw4">int</span></span></span>, <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">unsigned</span> <span class="kw4">long</span></span></span>, and <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">unsigned</span> <span class="kw4">long</span> <span class="kw4">long</span></span></span>;
</li><li> Any additional integral types needed by the typedefs in the header <a href="../header/cstdint.html" title="cpp/header/cstdint"><tt>&lt;cstdint&gt;</tt></a>.
</li></ul>
</dd></dl>
<p>Additionally, the resulting <code>std::atomic&lt;<i>Integral</i>&gt;</code> specialization has standard layout<span class="t-rev-inl t-until-cxx20"><span>, a trivial default constructor,</span> <span><span class="t-mark-rev t-until-cxx20">(until C++20)</span></span></span> and a trivial destructor. Signed integer arithmetic is defined to use two's complement; there are no undefined results.
</p>
 <table class="t-rev-begin">
<tr class="t-rev t-since-cxx20"><td>
<h4> <span class="mw-headline" id="Specializations_for_floating-point_types"> Specializations for floating-point types </span></h4>
<p>When instantiated with one of the standard floating-point types <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">float</span></span></span>, <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">double</span></span></span>, and <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">long</span> <span class="kw4">double</span></span></span><span class="t-rev-inl t-since-cxx23"><span>, or one extended floating-point type</span> <span><span class="t-mark-rev t-since-cxx23">(since C++23)</span></span></span>, <code>std::atomic</code> provides additional atomic operations appropriate to floating-point types such as <a href="atomic/fetch_add.html" title="cpp/atomic/atomic/fetch add"><code>fetch_add</code></a> and <a href="atomic/fetch_sub.html" title="cpp/atomic/atomic/fetch sub"><code>fetch_sub</code></a>.
</p><p>Additionally, the resulting <code>std::atomic&lt;<i>Floating</i>&gt;</code> specialization has standard layout and a trivial destructor.
</p><p>No operations result in undefined behavior even if the result is not representable in the floating-point type. The <a href="../numeric/fenv.html" title="cpp/numeric/fenv">floating-point environment</a> in effect may be different from the calling thread's floating-point environment.
</p>
</td>
<td><span class="t-mark-rev t-since-cxx20">(since C++20)</span></td></tr>
</table>
<h3><span class="mw-headline" id="Type_aliases"> Type aliases </span></h3>
<p>Type aliases are provided for <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span></span></span> and all integral types listed above, as follows:
</p>
<table class="t-dsc-begin">

<tr>
<td colspan="2"> <h5> <span class="mw-headline" id="Aliases_for_all_std::atomic.3CIntegral.3E">  Aliases for all <code>std::atomic&lt;Integral&gt;</code> </span></h5>
</td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_bool</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">bool</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_char</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">char</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_schar</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">signed</span> <span class="kw4">char</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uchar</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">unsigned</span> <span class="kw4">char</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_short</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">short</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_ushort</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">unsigned</span> <span class="kw4">short</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">int</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">unsigned</span> <span class="kw4">int</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_long</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">long</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_ulong</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">unsigned</span> <span class="kw4">long</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_llong</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">long</span> <span class="kw4">long</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_ullong</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">unsigned</span> <span class="kw4">long</span> <span class="kw4">long</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_char8_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span>char8_t<span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_char16_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">char16_t</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_char32_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">char32_t</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_wchar_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><span class="kw4">wchar_t</span><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int8_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark">(optional)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw112">std::<span class="me2">int8_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint8_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark">(optional)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw126">std::<span class="me2">uint8_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int16_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark">(optional)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw113">std::<span class="me2">int16_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint16_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark">(optional)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw127">std::<span class="me2">uint16_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int32_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark">(optional)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw114">std::<span class="me2">int32_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint32_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark">(optional)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw128">std::<span class="me2">uint32_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int64_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark">(optional)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw115">std::<span class="me2">int64_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint64_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark">(optional)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw129">std::<span class="me2">uint64_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int_least8_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw120">std::<span class="me2">int_least8_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint_least8_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw134">std::<span class="me2">uint_least8_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int_least16_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw121">std::<span class="me2">int_least16_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint_least16_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw135">std::<span class="me2">uint_least16_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int_least32_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw122">std::<span class="me2">int_least32_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint_least32_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw136">std::<span class="me2">uint_least32_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int_least64_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw123">std::<span class="me2">int_least64_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint_least64_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw137">std::<span class="me2">uint_least64_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int_fast8_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw116">std::<span class="me2">int_fast8_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint_fast8_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw130">std::<span class="me2">uint_fast8_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int_fast16_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw117">std::<span class="me2">int_fast16_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint_fast16_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw131">std::<span class="me2">uint_fast16_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int_fast32_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw118">std::<span class="me2">int_fast32_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint_fast32_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw132">std::<span class="me2">uint_fast32_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_int_fast64_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw119">std::<span class="me2">int_fast64_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uint_fast64_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw133">std::<span class="me2">uint_fast64_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_intptr_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark">(optional)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw125">std::<span class="me2">intptr_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uintptr_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span><span class="t-mark">(optional)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw139">std::<span class="me2">uintptr_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_size_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/size_t.html"><span class="kw106">std::<span class="me2">size_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_ptrdiff_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/ptrdiff_t.html"><span class="kw107">std::<span class="me2">ptrdiff_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_intmax_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw124">std::<span class="me2">intmax_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_uintmax_t</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span><a href="../types/integer.html"><span class="kw138">std::<span class="me2">uintmax_t</span></span></a><span class="sy1">&gt;</span></span></span>  <br> <span class="t-mark">(typedef)</span> </td></tr>

<tr>
<td colspan="2"> <h5> <span class="mw-headline" id="Aliases_for_special-purpose_types">  Aliases for special-purpose types </span></h5>
</td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_signed_lock_free</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   a signed integral atomic type that is lock-free and for which waiting/notifying is most efficient <br> <span class="t-mark">(typedef)</span> </td></tr>


<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><strong class="selflink"> <span class="t-lines"><span>atomic_unsigned_lock_free</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   a unsigned integral atomic type that is lock-free and for which waiting/notifying is most efficient <br> <span class="t-mark">(typedef)</span> </td></tr>
</table>
Note: <code>std::atomic_int<i>N</i>_t</code>, <code>std::atomic_uint<i>N</i>_t</code>, <code>std::atomic_intptr_t</code>, and <code>atomic_uintptr_t</code> are defined if and only if <code>std::int<i>N</i>_t</code>, <code>std::uint<i>N</i>_t</code>, <code>std::intptr_t</code>, and <code>std::uintptr_t</code> are defined, respectively.  <table class="t-rev-begin">
<tr class="t-rev t-since-cxx20"><td>
<p><code>std::atomic_signed_lock_free</code> and <code>std::atomic_unsigned_lock_free</code> are optional in freestanding implementations.
</p>
</td>
<td><span class="t-mark-rev t-since-cxx20">(since C++20)</span></td></tr>
</table>
<h3><span class="mw-headline" id="Member_types">Member types</span></h3>
<table class="t-dsc-begin">

<tr class="t-dsc-hitem">
<td>  Member type
</td>
<td>  Definition
</td></tr>


<tr class="t-dsc">
<td>  <code>value_type</code>
</td>
<td>  <code>T</code> <span class="t-mark">(regardless of whether specialized or not)</span>
</td></tr>


<tr class="t-dsc">
<td>  <code>difference_type</code>
</td>
<td>  <code>value_type</code> <span class="t-mark">(only for <code>atomic&lt;<i>Integral</i>&gt;</code> <span class="t-rev-inl t-since-cxx20"><span>and <code>atomic&lt;<i>Floating</i>&gt;</code></span> <span><span class="t-mark-rev t-since-cxx20">(since C++20)</span></span></span> specializations)</span><br> <span class="t-lc"><a href="../types/ptrdiff_t.html" title="cpp/types/ptrdiff t">std::ptrdiff_t</a></span> <span class="t-mark">(only for <code>atomic&lt;U*&gt;</code> specializations)</span>
</td></tr>

</table>
<p><code>difference_type</code> is not defined in the primary <code>atomic</code> template or in the partial specializations for <span class="t-lc"><a href="../memory/shared_ptr.html" title="cpp/memory/shared ptr">std::shared_ptr</a></span> and <span class="t-lc"><a href="../memory/weak_ptr.html" title="cpp/memory/weak ptr">std::weak_ptr</a></span>.
</p>
<h3><span class="mw-headline" id="Member_functions">Member functions</span></h3>
<table class="t-dsc-begin">

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div t-dsc-member-nobold-div"><div><a href="atomic/atomic.html" title="cpp/atomic/atomic/atomic"> <span class="t-lines"><span>(constructor)</span></span></a></div></div>
</td>
<td>  constructs an atomic object <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/operator%3D.html" title="cpp/atomic/atomic/operator="> <span class="t-lines"><span>operator=</span></span></a></div></div>
</td>
<td>   stores a value into an atomic object <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/is_lock_free.html" title="cpp/atomic/atomic/is lock free"> <span class="t-lines"><span>is_lock_free</span></span></a></div></div>
</td>
<td>   checks if the atomic object is lock-free <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/store.html" title="cpp/atomic/atomic/store"> <span class="t-lines"><span>store</span></span></a></div></div>
</td>
<td>   atomically replaces the value of the atomic object with a non-atomic argument  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/load.html" title="cpp/atomic/atomic/load"> <span class="t-lines"><span>load</span></span></a></div></div>
</td>
<td>   atomically obtains the value of the atomic object  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/operator_T.html" title="cpp/atomic/atomic/operator T"> <span class="t-lines"><span>operator T</span></span></a></div></div>
</td>
<td>   loads a value from an atomic object  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/exchange.html" title="cpp/atomic/atomic/exchange"> <span class="t-lines"><span>exchange</span></span></a></div></div>
</td>
<td>   atomically replaces the value of the atomic object and obtains the value held previously <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/compare_exchange.html" title="cpp/atomic/atomic/compare exchange"> <span class="t-lines"><span>compare_exchange_weak</span><span>compare_exchange_strong</span></span></a></div></div>
</td>
<td>   atomically compares the value of the atomic object with non-atomic argument and performs atomic exchange if equal or atomic load if not  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/wait.html" title="cpp/atomic/atomic/wait"> <span class="t-lines"><span>wait</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   blocks the thread until notified and the atomic value changes  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/notify_one.html" title="cpp/atomic/atomic/notify one"> <span class="t-lines"><span>notify_one</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   notifies at least one thread waiting on the atomic object  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/notify_all.html" title="cpp/atomic/atomic/notify all"> <span class="t-lines"><span>notify_all</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   notifies all threads blocked waiting on the atomic object  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr>
<td colspan="2"> <h3> <span class="mw-headline" id="Constants"> Constants</span></h3>
</td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/is_always_lock_free.html" title="cpp/atomic/atomic/is always lock free"> <span class="t-lines"><span>is_always_lock_free</span></span></a></div><div><span class="t-lines"><span><span class="t-cmark">[static]</span> <span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div>
</td>
<td>   indicates that the type is always lock-free <br> <span class="t-mark">(public static member constant)</span> </td></tr>
</table>
<h3><span class="mw-headline" id="Specialized_member_functions">Specialized member functions</span></h3>
<table class="t-dsc-begin">

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/fetch_add.html" title="cpp/atomic/atomic/fetch add"> <span class="t-lines"><span>fetch_add</span></span></a></div></div>
</td>
<td>   atomically adds the argument to the value stored in the atomic object and obtains the value held previously  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/fetch_sub.html" title="cpp/atomic/atomic/fetch sub"> <span class="t-lines"><span>fetch_sub</span></span></a></div></div>
</td>
<td>   atomically subtracts the argument from the value stored in the atomic object and obtains the value held previously  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/fetch_and.html" title="cpp/atomic/atomic/fetch and"> <span class="t-lines"><span>fetch_and</span></span></a></div></div>
</td>
<td>   atomically performs bitwise AND between the argument and the value of the atomic object and obtains the value held previously  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/fetch_or.html" title="cpp/atomic/atomic/fetch or"> <span class="t-lines"><span>fetch_or</span></span></a></div></div>
</td>
<td>   atomically performs bitwise OR between the argument and the value of the atomic object and obtains the value held previously  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/fetch_xor.html" title="cpp/atomic/atomic/fetch xor"> <span class="t-lines"><span>fetch_xor</span></span></a></div></div>
</td>
<td>   atomically performs bitwise XOR between the argument and the value of the atomic object and obtains the value held previously  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/operator_arith.html" title="cpp/atomic/atomic/operator arith"> <span class="t-lines"><span>operator++</span><span>operator++<span class="t-dsc-small">(int)</span></span><span>operator--</span><span>operator--<span class="t-dsc-small">(int)</span></span></span></a></div></div>
</td>
<td>   increments or decrements the atomic value by one  <br> <span class="t-mark">(public member function)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic/operator_arith2.html" title="cpp/atomic/atomic/operator arith2"> <span class="t-lines"><span>operator+=</span><span>operator-=</span><span>operator&amp;=</span><span>operator|=</span><span>operator^=</span></span></a></div></div>
</td>
<td>   adds, subtracts, or performs bitwise AND, OR, XOR with the atomic value <br> <span class="t-mark">(public member function)</span> </td></tr>
</table>
<h3><span class="mw-headline" id="Notes">Notes</span></h3>
<p>There are non-member function template equivalents for all member functions of <code>std::atomic</code>. Those non-member functions may be additionally overloaded for types that are not specializations of <code>std::atomic</code>, but are able to guarantee atomicity. The only such type in the standard library is <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../memory/shared_ptr.html"><span class="kw735">std::<span class="me2">shared_ptr</span></span></a><span class="sy1">&lt;</span>U<span class="sy1">&gt;</span></span></span>.
</p><p><code>_Atomic</code> is a <a href="../../c/keyword/_Atomic.html" title="c/keyword/ Atomic">keyword</a> and used to provide <a href="../../c/language/atomic.html" title="c/language/atomic">atomic types</a> in C.
</p><p>Implementations are recommended to ensure that the representation of <span class="t-c"><span class="mw-geshi cpp source-cpp">_Atomic<span class="br0">(</span>T<span class="br0">)</span></span></span> in C is same as that of <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">atomic</span><span class="sy1">&lt;</span>T<span class="sy1">&gt;</span></span></span> in C++ for every possible type <code>T</code>. The mechanisms used to ensure atomicity and memory ordering should be compatible.
</p><p>On gcc and clang, some of the functionality described here requires linking against <code>-latomic</code>.
</p>
<h3><span class="mw-headline" id="Defect_reports">Defect reports</span></h3>
<p>The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
</p>
<table class="dsctable" style="font-size:0.8em">
<tr>
<th> DR
</th>
<th> Applied to
</th>
<th> Behavior as published
</th>
<th> Correct behavior
</th></tr>
<tr>
<td> <a rel="nofollow" class="external text" href="https://cplusplus.github.io/LWG/issue2441">LWG 2441</a>
</td>
<td> C++11
</td>
<td> typedefs for atomic versions of optional<br><a href="../types/integer.html" title="cpp/types/integer">fixed width integer types</a> were missing
</td>
<td> added
</td></tr>
<tr>
<td> <a rel="nofollow" class="external text" href="https://wg21.link/P0558R1">P0558R1</a>
</td>
<td> C++11
</td>
<td> template argument deduction for some functions<br>for atomic types might accidently fail;<br>invalid pointer operations were provided
</td>
<td> specification was substantially rewritten:<br>member typedefs <code>value_type</code> and <code>difference_type</code> are added
</td></tr>
<tr>
<td> <a rel="nofollow" class="external text" href="https://cplusplus.github.io/LWG/issue3012">LWG 3012</a>
</td>
<td> C++11
</td>
<td> <code>std::atomic&lt;T&gt;</code> was permitted for<br>any <code>T</code> that is trivially copyable but not copyable
</td>
<td> such specializations are forbidden
</td></tr></table>
<h3><span class="mw-headline" id="See_also">See also</span></h3>
<table class="t-dsc-begin">

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="atomic_flag.html" title="cpp/atomic/atomic flag"> <span class="t-lines"><span>atomic_flag</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div>
</td>
<td>   the lock-free boolean atomic type  <br> <span class="t-mark">(class)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../memory/shared_ptr/atomic2.html" title="cpp/memory/shared ptr/atomic2"> <span class="t-lines"><span>std::atomic<span class="t-dsc-small">&lt;std::shared_ptr&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   atomic shared pointer  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../memory/weak_ptr/atomic2.html" title="cpp/memory/weak ptr/atomic2"> <span class="t-lines"><span>std::atomic<span class="t-dsc-small">&lt;std::weak_ptr&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   atomic weak pointer  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

</table>

<!-- 
NewPP limit report
Preprocessor visited node count: 19651/1000000
Preprocessor generated node count: 20033/1000000
Post‐expand include size: 674265/2097152 bytes
Template argument size: 135289/2097152 bytes
Highest expansion depth: 22/40
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key mwiki1-mwiki_en_:pcache:idhash:4734-0!*!0!!en!*!* and timestamp 20220726182647 -->
</div>                    <!-- /bodycontent -->
                                        <!-- printfooter -->
                    <div class="printfooter">
                    Retrieved from "<a href="https://en.cppreference.com/mwiki/index.php?title=cpp/atomic/atomic&amp;oldid=141391">https://en.cppreference.com/mwiki/index.php?title=cpp/atomic/atomic&amp;oldid=141391</a>"                    </div>
                    <!-- /printfooter -->
                                                            <!-- catlinks -->
                    <!-- /catlinks -->
                                                            <div class="visualClear"></div>
                    <!-- debughtml -->
                                        <!-- /debughtml -->
                </div>
                <!-- /bodyContent -->
            </div>
        </div>
        <!-- /content -->
        <!-- footer -->
        <div id="cpp-footer-base" class="noprint">
            <div id="footer">
                        <div id="cpp-navigation">
            <h5>Navigation</h5>
            <ul><li><a href="https://en.cppreference.com/w/cpp/atomic/atomic">Online version</a></li><li>Offline version retrieved 2022-07-30 14:05.</li></ul></div>
                        <ul id="footer-info">
                                    <li id="footer-info-lastmod"> This page was last modified on 26 July 2022, at 02:46.</li>
                                    <li id="footer-info-viewcount">This page has been accessed 2,254,816 times.</li>
                            </ul>
                    </div>
        </div>
        <!-- /footer -->
        <script>if(window.mw){
mw.loader.state({"site":"loading","user":"missing","user.groups":"ready"});
}</script>
<script src="../../../common/skin_scripts.js"></script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.page.ready","mediawiki.searchSuggest","mediawiki.hidpi","ext.gadget.ColiruCompiler","ext.gadget.MathJax"], null, true);
}</script>
<script src="../../../common/site_scripts.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2828341-1']);
_gaq.push(['_setDomainName', 'cppreference.com']);
_gaq.push(['_trackPageview']);
</script><!-- Served in 7.644 secs. -->
	</body>
<!-- Cached 20220726182647 -->
</html>